package BookStore.dao;

import BookStore.model.Book_d;
import BookStore.util.VDbUtil;

import javax.swing.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Book_dDao {
    private Book_d book_d;

    public Book_dDao(Book_d temp_d){
        this.book_d = temp_d;
    }
    public void delete() throws Exception {
        Connection con_2_1 =VDbUtil.getCon_2_1();
        String sql_1 = "delete from BOOK where id = '" + book_d.getBookId_1() + "'";
        PreparedStatement ps_1 = con_2_1.prepareStatement(sql_1);
        ResultSet del = ps_1.executeQuery();
        JOptionPane.showMessageDialog(null,"书籍删除成功");

        con_2_1.close();
        ps_1.close();
    }
}
